package behavioral.command_partten;

/**
 * @ClassName: AddCommand
 * @Description: 具体的命令类
 * @Author: liu-hao
 * @Date: 2023-04-11 22:37
 * @Version: 1.0
 **/
public class AddCommand implements Command {
    private Receiver receiver;

    public AddCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        receiver.add();
    }

    @Override
    public void undo() {
        receiver.undoAdd();
    }
}
